<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue入门练习</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="../js/index.js"></script>


</head>

<body>
    <div id="root">
        <h3>
            <p>购物清单</p>
            <p>列表数量{{lists.length}}</p>
        </h3>
        <input type="text" class="inp" v-model="text" />
        <button class="btn btn-primary" @click="add(text)">添加</button>
        <table class="table table-striped">
            <thead>
                <tr>
                    <td>商品名称</td>
                    <td>状态</td>
                    <td>操作</td>
                </tr>
            </thead>
            <tr v-for="(item,index) in lists">
                <td>
                    {{item.name}}


                </td>
                <td>
                    {{item.state | statefilter}}
                </td>
                <td>
                    <button class="tugger " @click="del(index)">删除</button>
                </td>
            </tr>
        </table>
    </div>

</body>

</html>